In encoding video, it is common to use interframe prediction to obtain high compression efficiency. In the encoding using the interframe prediction, intra-frames and inter-frames are configured. In the intra-frame, a frame image is independently encoded without reference to another frame image. On the other hand, in the inter-frame, a frame image is encoded with reference to one or plural other frame images positioned earlier or later in time. Since in the inter-frame, the frame image can be encoded by defining a difference from the other frame images, exceedingly high compression efficiency can be obtained.
Meanwhile, a technology is proposed in which encoding processing is changed according to the contents of the video to improve image quality under a limited amount of data. For example, Patent Literature 1 discloses a technology in which a portion with a complex pattern in the frame image is beforehand detected, the quantization step width for the portion is increased in encoding, and thereby, excessively large data is prevented from occurring to maintain the image quality in the entire frame image. In such a technology, 2-pass encoding processing is performed in which the contents of the frame image are analyzed first, and using the result, the encoding is performed.
However, such a technology is not suitable for, for example, streaming in which the frame images generated in real time are sequentially encoded to be sent. When the generation and the sending of the frame images have to be in real time, the processing time is limited and the encoding processing is basically performed in a 1-pass manner. Therefore, 2-pass encoding processing as above is difficult to be adopted. Hence, in Patent Literature 2, a technology is proposed in which the degree of encoding difficulty is beforehand defined for each of the kinds of the video (for example, “motion picture” and the like), based on this, the bit rate in encoding is determined, and thereby, optimization of the encoding processing is alternatively realized in the 1-pass encoding processing.